Skip to content

Conversation

@rvagg
Copy link
Collaborator

@rvagg rvagg commented Oct 7, 2025

Closes: #226

@LexLuthr we're only going to need one of these, right? We're not going to use a second one if we advertise PieceCID as well?

I'm thinking that we can use this to do a cross-reference with cid.contact that the SP has actually published something. A check for the root CID will have to be enough, and is most likely sufficient for most use cases anyway.

@rvagg rvagg requested a review from LexLuthr October 7, 2025 06:32
@FilOzzy FilOzzy added this to FS Oct 7, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Oct 7, 2025
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FS Oct 7, 2025
@LexLuthr
Copy link
Collaborator

LexLuthr commented Oct 7, 2025

Closes: #226

@LexLuthr we're only going to need one of these, right? We're not going to use a second one if we advertise PieceCID as well?

I'm thinking that we can use this to do a cross-reference with cid.contact that the SP has actually published something. A check for the root CID will have to be enough, and is most likely sufficient for most use cases anyway.

Yes, we only need 1. MKv2 uses a single peerID per provider to publish all ads. PDPV0 only seem to publish IPFS so this will work for both.

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FS Oct 7, 2025
minProvingPeriodInEpochs: 2880,
location: "US-Central",
paymentTokenAddress: IERC20(address(0)) // Payment in FIL
paymentTokenAddress: IERC20(address(0)), // Payment in FIL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a constant like

IERC20 constant NATIVE_FIL = IERC20(address(0))

can declare it outside of the test contract

@rjan90
Copy link
Collaborator

rjan90 commented Oct 14, 2025

Just trying to plan a bit ahead, does this change require a new deployment of the ServiceProviderRegistry?

uint256 minProvingPeriodInEpochs; // Minimum proving period in epochs
string location; // Geographic location of the service provider
IERC20 paymentTokenAddress; // Token contract for payment (IERC20(address(0)) for FIL)
string ipniPeerId; // IPNI peer ID as CID string (max 256 chars, can be empty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could some of these be capabilityKeys instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original plan was to push more into capabilities and have fewer opinions about this object struct, what we've ended up with is as a result of negotiation.
But where we landed was treating the struct as "schema of things we know we'll want" and capabilities as "unknowns" then this one fits in the struct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broader discussion here: #297

I think INPI makes sense as a capability, and we should probably use capabilities for all optional fields.

@rvagg
Copy link
Collaborator Author

rvagg commented Oct 14, 2025

@rjan90 yes it does.
We agreed (sync) to go with bytes, I just haven't had a chance to finish this up, I think I just need to roll back one or two of the commits.

@rvagg
Copy link
Collaborator Author

rvagg commented Oct 14, 2025

Although technically I don't think this is breaking and could be upgraded in the implementation and we wouldn't need a new contract deployment, I think that's right @wjmelements? If we add to the end then it's an upgrade and existing clients can still abi.decode into the rest of the struct and just ignore this?

@wjmelements
Copy link
Contributor

Although technically I don't think this is breaking and could be upgraded in the implementation and we wouldn't need a new contract deployment, I think that's right @wjmelements? If we add to the end then it's an upgrade and existing clients can still abi.decode into the rest of the struct and just ignore this?

It breaks the ABI of encodePDPOffering because it changes the 4byte signature. I'm not sure if it breaks decodePDPOffering et al decoding; it would depend on if the library ignores extra data. It should be fine on-chain though.

Appending to structs is generally upgrade-safe for proxy storage layouts. However, essentially all fields are permanent after that.

@wjmelements
Copy link
Contributor

Appending to structs is generally upgrade-safe for proxy storage layouts. However, essentially all fields are permanent after that.

Upon further review, this isn't appending to a struct but to encoded bytes storage. So this would break the product data.

@wjmelements wjmelements changed the title feat: add ipniPeerId to PDPOffering in ServiceProviderRegistry feat!(ServiceProviderRegistry): add ipniPeerId to PDPOffering Oct 17, 2025
@rvagg
Copy link
Collaborator Author

rvagg commented Oct 17, 2025

this has been rolled back to bytes and updated to current main

as long as we have ipniPiece and ipniIpfs in PDPOffering then I'd like ipniPeerId to be alongside it; I could move it up if we're agreeing it would be breaking anyway

@wjmelements
Copy link
Contributor

as long as we have ipniPiece and ipniIpfs in PDPOffering then I'd like ipniPeerId to be alongside it; I could move it up if we're agreeing it would be breaking anyway

That makes sense because these fields are related. I still think they could be bundled into an IPNI capability.

Alternatively I was thinking these bool flags could be bundled into a uint256 flags field, because abi.encode will use 32 bytes per bool, and because we might want more flags.

@wjmelements
Copy link
Contributor

superceded by #308

@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FS Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

add PeerID for PDP offering metadata

5 participants